import Vue from 'vue'
import Router from 'vue-router'
const home = (resolve) => {
  import('@/components/pages/HelloWorld').then((module) => {
    resolve(module)
  })
}
const jifen = (resolve) => {
  import('@/components/pages/jifen').then((module) => {
    resolve(module)
  })
}
const wei = (resolve) => {
  import('@/components/pages/wei').then((module) => {
    resolve(module)
  })
}
const users = (resolve) => {
  import('@/components/pages/user').then((module) => {
    resolve(module)
  })
}
const one = (resolve) => {
  import('@/components/pages/one').then((module) => {
    resolve(module)
  })
}
const aaa = (resolve) => {
  import('@/components/pages/aaa').then((module) => {
    resolve(module)
  })
}
const lifecycle = (resolve) => {
  import('@/components/pages/lifecycle').then((module) => {
    resolve(module)
  })
}
const checked = (resolve) => {
  import('@/components/pages/checked').then((module) => {
    resolve(module)
  })
}
const pullDown = (resolve) => {
  import('@/components/pages/pullDown').then((module) => {
    resolve(module)
  })
}
const dialog = (resolve) => {
  import('@/components/pages/dialog').then((module) => {
    resolve(module)
  })
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      meta:{
        title:'首页'
      }
    },
    {
      path: '/jifen',
      name: 'jifen',
      component: jifen,
      meta:{
        title:'积分商城'
      }
    },
    {
      path: '/wei',
      name: 'wei',
      component: wei,
      meta:{
        title:'微服务'
      }
    },
    {
      path: '/users',
      name: 'users',
      component: users,
      meta:{
        title:'个人中心'
      }
    },
    {
      path: '/one',
      name: 'one',
      component: one,
      meta:{
        title:'第一无底栏'
      }
    },
    {
      path: '/aaa',
      name: 'aaa',
      component: aaa,
      meta:{
        title:'全选'
      }
    },
    {
      path: '/lifecycle',
      name: 'lifecycle',
      component: lifecycle,
      meta:{
        title:'生命周期测试'
      }
    },
    {
      path: '/checked',
      name: 'checked',
      component: checked,
      meta:{
        title:'测试全选'
      }
    },
    {
      path: '/pullDown',
      name: 'pullDown',
      component: pullDown,
      meta:{
        title:'下拉刷新'
      }
    },
    {
      path: '/dialog',
      name: 'dialog',
      component: dialog,
      meta:{
        title:'弹框'
      }
    },
   {
			path: "*",
			redirect: "/home"
		}
  ]
})
